package com.hyt.it.ogt.kq.service.bm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hyt.it.ogt.kq.service.bm.model.entity.UserPermission;
import com.hyt.it.ogt.kq.service.bm.model.vo.UserPermissionInfo;
import com.hyt.it.ogt.kq.service.bm.model.vo.UserPermissionStatVo;
import com.hyt.model.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liteng
 * @since 2021-03-01
 */
public interface UserPermissionMapper extends BaseMapper<UserPermission> {

    List<UserPermissionInfo> queryUserPermissionVo(@Param("projectId") String projcetId, @Param("userId") String userId);

    /**
     * 获取报名的权限
     *
     * @param userId 用户ID
     * @param projectIds 报名集合
     * @return
     */
    List<UserPermissionInfo> queryUserPermissionByProject(@Param("userId") String userId, @Param("projectIds") List<String> projectIds);

	IPage<UserPermissionInfo> queryPermissionPage(PageParam<UserPermissionInfo> pageParam, @Param("projectId") String projectId, @Param("userIds") Set<String> userIds, @Param("areaCodes") List<String> areaCodes);

	void deleteUserPermission(@Param("projectId") String enrollId, @Param("userIds") String[] userIds);

    List<UserPermissionStatVo> statTimeStudent(@Param("officeId") String officeId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<UserPermissionStatVo> statTimeOfficeStudent(@Param("officeId") String officeId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("deptId") String deptId);

    List<UserPermissionStatVo> statDateStudent(@Param("officeId") String officeId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<UserPermissionStatVo> statDateOfficeStudent(@Param("officeId") String officeId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("deptId") String deptId);
}
